package com.slofzx.nuoda.evaluation.param.enums;

import com.slofzx.nuoda.common.enums.SysPermission;

/**
 * 系统权限枚举
 * @author sunfuyong
 */
public enum PermissionEnum implements SysPermission {
    COMMON_PARAM_RECORD("common_param:record", "公共参数维护", "公共参数数据维护"),
    COMMON_PARAM_VIEW("common_param:view", "公共参数查看", "公共参数标准查看"),
    COMMON_PARAM_DELETE("common_param:delete", "公共参数删除", "公共参数标准删除"),
    ;

    private String desc;
    private String id;
    private String name;

    @Override
    public String getDescription() {
        return this.desc;
    }

    @Override
    public String getId() {
        return this.id;
    }

    @Override
    public String getName() {
        return this.name;
    }

    PermissionEnum(String id, String name, String desc) {
        this.id = id;
        this.name = name;
        this.desc = desc;
    }

    public static PermissionEnum getEnum(String id) {
        for(PermissionEnum value: PermissionEnum.values()) {
            if (value.getId().equals(id)) {
                return value;
            }
        }

        return null;
    }
}
